<div id="sidebar">

<div id="pages">
<h3>Pages</h3>
<ul>
		{{self.m_list_pages}}
</ul>
</div>

<h3>Search</h3>
<p class="searchinfo"></p>
<div id="search">
<div id="search_area">
<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1');
  google.setOnLoadCallback(function(){
    new google.search.CustomSearchControl().draw('cse');
  }, true);
</script>
    
</div>
</div>

<h3>Recent Comments</h3>
<ul>
{% for comment in recent_comments %}
<li><a href="/{{comment.entry.link}}#comment-{{comment.key.id}}">{{comment.author}}:{{comment.shortcontent}}...</a> </li>
{%endfor%}

</ul>

{% if categories %}
<h3>Categories</h3>
<ul>
    {%for cate in categories%}
  {% if cate.count %}<li>	<a href="/category/{{cate.slug}}">{{cate.name}}({{cate.count}})</a></li>{%endif%}
 	{%endfor%}
</ul>
{% endif %}

{% if archives %}
<h3>Archives</h3>
<ul>
    {%for archive in archives%}
  <li>	<a href="/{{archive.year}}/{{archive.month}}">{{archive.monthyear}}</a></li>
 	{%endfor%}
</ul>
{% endif %}

{% if alltags %}
<h3>Tags</h3>
<ul id="tag-cloud">
    {% for tag in alltags %}
	<li class="t{{tag.tagcount|restrict_to_max:"5"}}"><a href="/tag/{{tag.tag}}">{{tag.tag}}</a></li>
	{% endfor %}
</ul>
{%endif %}

<h3>Blogroll</h3>
<ul>
{%for link in blogroll%}
<li><a href="{{link.href}}">{{link.linktext}}</a></li>
{%endfor%}
</ul>

<h3>Meta</h3>
<ul>
<li class="page_item" ><a href="{{blog.feedurl}}">(RSS)</a></li>
{% block topmenu %}{% endblock %}

{%if self.is_admin%}
<li><a href="/admin/post">Write</a> </li>
 <li><a href="/admin">Admin</a> </li>
{%endif%}
  <li>
 {%if self.is_login%}

   <a href="{{self.logouturl}}">Logout</a>

 {%else%}
   <a href="/admin">Login</a>

 {%endif%}
     </li>

</ul>
</div>